/*------------------------------------------------------------------------------

 Copyright 2007 Luc Fourestier

 The copyright to the computer program(s) herein is the property of Luc
 Fourestier. The program(s) may be used and/or copied only with the written
 permission of Luc Fourestier or in accordance with the terms and conditions
 stipulated in the agreement/contract under which the program(s) have been
 supplied.

 Contact: luc.fourestier@gmail.com

------------------------------------------------------------------------------*/
/**
 @mainpage

 @section copyright Copyright
    The copyright to the computer program(s) herein is the property of Luc
    Fourestier. The program(s) may be used and/or copied only with the written
    permission of Luc Fourestier or in accordance with the terms and conditions
    stipulated in the agreement/contract under which the program(s) have been
    supplied.

    Contact: lfourestier@yahoo.fr


 @file    colibri.h

    This file provides the general definitions used in the entire colibri.

 @author  Luc Fourestier
 @version 0.1
 @date    2007

*/
/*----------------------------------------------------------------------------*/

#ifndef COLIBRI_H
#define COLIBRI_H


/*------------------------------------------------------------------------------
 Tracing
------------------------------------------------------------------------------*/

#ifdef DEBUG

/**
Tracing is a simple string trace organised in sections. Each section is
delimited, at run time, by consecutives TRACE_IN and TRACE_OUT.
You enter a section with TRACE_IN and go out with TRACE_OUT.
Any other traces in between are considered belonging to that section.
A section can belong to another section. Two consecutive TRACE_IN are allowed.
We call then this section, subsection.
We can then, consider the tracing as an outline of traces.
Each function must start with a TRACE_IN and return with a TRACE_OUT.

TRACE_IN Enter a new trace section and trace the string.
TRACE Trace within a section.
WATCH Watch a value within a section.
TRACE_OUT Trace the string and exit a trace section.
ASSERT block the execution if false.
*/
#define TRACE_IN(string)
#define TRACE(string)
#define WATCH(string, integer)
#define TRACE_OUT(string)
#define ASSERT(expression)

#else

#define ASSERT(expression)
#define TRACE_IN(string)
#define TRACE(string)
#define TRACE_OUT(string)
#define WATCH(string, integer)

#endif /* DEBUG */


/*------------------------------------------------------------------------------
 Variable types C99
------------------------------------------------------------------------------*/


typedef unsigned char uint8_t;   /* 8 bit unsigned integer */
typedef unsigned short uint16_t; /* 16 bit unsigned integer */
typedef unsigned int uint32_t;   /* 32 bit unsigned integer */
typedef signed char int8_t;      /* 8 bit signed integer */
typedef signed short int16_t;    /* 16 bit signed integer */
typedef signed int int32_t;      /* 32 bit signed integer */


/*------------------------------------------------------------------------------
 Return status
------------------------------------------------------------------------------*/

/**
 status type. This status is used to return error or success status in a function.
 Each binomial can define it own status beside the following general ones.
 Different status can have the same value trhoughout the complete code as long
 as they are properly catch and translated.
 The TRACE_OUT could be used to catch the error description string.
*/
typedef unsigned int Status_t;

#define STATUS_OK      ((Status_t)0)
#define STATUS_ERROR   ((Status_t)~0)


/*------------------------------------------------------------------------------
 Standard defines
------------------------------------------------------------------------------*/

#define NULL 0



#endif /* COLIBRI_H */
